const ssh = require('./ssh')

module.exports = async function (command, ...args) {
    const client = await ssh.connect(this.options)
    try {
        return await client[command]?.(...args)
    } finally {
        await client.close()
    }
}
